/*******************************************************************************
 * Copyright (c) 2013 Zero Square LLC.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Zero Square LLC. Version 1
 * which accompanies this distribution
 ******************************************************************************/
package com.zsqr.dashboard.services;
import com.zsqr.dashboard.domain.UserEntity;
import javax.faces.event.AjaxBehaviorEvent;

/**
 * Provide service method to work with user data and entity
 * @author Saurabh
 *
 */
public interface UserService {
	
	/**
     * Create user - persist to database
     * 
     * @param userEntity
     * @return true if success
     */
    boolean createUser(UserEntity userEntity);
    
    /**
     * Check user name availability. UI ajax use.
     * 
     * @param ajax event
     * @return
     */
    boolean checkAvailable(AjaxBehaviorEvent event);
    
    /**
     * Retrieves full User record from database by user name
     * 
     * @param userName
     * @return UserEntity
     */
    UserEntity loadUserEntityByUsername(String userName);
	
	boolean validateUser(UserEntity userEntity);
	boolean updateUser(UserEntity userEntity);
	boolean validateLogin(UserEntity userEntity);
	
}
